Removed PhotosAddOnly permission request within MediaPicker.ios#34287
Removed PhotosAddOnly permission request within MediaPicker.ios#34287Kyranio wants to merge 1 commit intodotnet:mainfrom
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34287Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34287" |
|
Hey there @@Kyranio! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
While that might be true, doesn't our implementation always save it to the gallery on iOS? We don't have an option to set the right now (see #30439), so because of that, we also need to have this permission now. If we make that optional for .NET 11, then we can make this permission optional as well |
If that is the case, then this might actually be a bug instead, as a photo taken with iOS (handled with MediaPicker) does in fact not save it to the gallery. The source code of the MediaPicker PhotoAsync method itself does not contain any logic indicating that the image is to be saved to the device itself, nor to it's gallery... which was why I initially posted the issue #34246 (under a different account, related to the company I work for) and created this pullrequest. It's also why I referenced the official documentation which contains a code-snippet, suggesting that a developer needs to save the image to the device after calling CapturePhotoAsync themselves, in their own code. This in itself led me to believe that requesting the permission shouldn't be within the PhotoAsync method but rather within the user's own code. If the PhotoAsync task should save the picture to the device's gallery regardless, the documentation would probably need to be updated. The PhotoAsync method might need to be looked at, however, as in our experience it does not add the pictures to the gallery by itself... |
Description of Change
Removed permission request for adding photos to the devices library on iOS, inside MediaPicker.ios, which doesn't need this permission at this spot inside the code as it does not add the newly captured photo to the device's library here.
Given the official documentation, adding the picture to the device's library is an action given in the example after the CapturePhotoAsync is called, if the task's result contains a value.
This action is completely optional, the developer could implement different logic for handling the picture data after calling CapturePhotoAsync, meaning the permission request becomes unnecessary and redundant.
It is up to the developer to save the image to the device, which then requires the permission, meaning the developer should implement the permission request within their own logic.
Issues Fixed
Fixes #34246